const express = require("express");
const middleware = require("./middleware");
const app = express();
const v1 = require("./routes/v1");
// 日志
middleware.logger(app);
// 核心中间件
middleware.core(app);
// session中间件
middleware.session(app);
//路由中间件
app.use("/api/v1", v1);
// 404中间件
middleware.notfound(app);
// 全局错误中间件
middleware.error(app);

module.exports = app;
